/*
 * @Description: 
 * @Author: 赵大壮
 * @Date: 2021-12-06 17:18:37
 * @LastEditTime: 2024-07-23 14:07:02
 * @LastEditors: 赵大壮
 */
import { Component, Vue, Inject } from "vue-property-decorator";
import DZServiceExport from "../../service/DZServiceExport";

@Component({
    components: {}
})
export default class Index extends Vue {

    s_export = new DZServiceExport();

    created() {
        this.action_list_export();
    }

    mounted() {
    }

    beforeDestroy() {
    }

    action_list_export() {
        this.s_export.net_list_export();
    }

    action_status_text(status, frozen) {
        var model = {
            text: '',
            color: ''
        }
        if (status == 1) {
            if (frozen == 1) {
                model.text = '正常';
                model.color = 'text-cmain'
            } else {
                model.text = '冻结';
                model.color = 'text-c9'
            }
        } else {
            model.text = '待审核';
            model.color = 'text-cwarn'
        }
        return model;
    }

    action_page_change(current) {
        this.s_export.m_page.page = current;
        this.action_list_export();
    }

    action_info(id) {
        this.$router.push({ path: '/export/info', query: { id: id } })
    }

    action_frozen(id) {
        this.s_export.net_change_status(id, () => {
            this.action_list_export();
        });
    }

    action_del(id) {
        this.s_export.net_del_export(id, () => {
            this.action_list_export();
        });
    }

    action_sort_save(row) {
        this.s_export.net_edit_sort(row.id, row.sort, () => {
            this.action_list_export();
        })
    }

    action_move_up(row) {
        this.s_export.net_move_up(row.id, () => {
            this.action_list_export();
        });
    }

    action_move_down(row) {
        this.s_export.net_move_down(row.id, () => {
            this.action_list_export();
        });
    }

    action_move_top(row) {
        this.s_export.net_move_top(row.id, () => {
            this.action_list_export();
        });
    }

    action_cancel_top(row) {
        this.s_export.net_cancel_top(row.id, () => {
            this.action_list_export();
        });
    }
}